#include <stdio.h>
#include <string.h>
#include <iostream>
#include <string>
using namespace std;
#define XXXX "$OA"
#define YYYY "$DA"
#define ABC "hellow$OAxxx"
int main(int argc, char* argv[]) {
  string a(ABC);
  string::size_type pos_start = 0;
  string::size_type pos_end = 0;
  pos_start = a.find(XXXX);
  string b = a.substr(0,pos_start);
  cout<<b<<endl;
  string phone="110";
  a.replace(pos_start, strlen(XXXX), phone);
  cout <<a<<endl;

  pos_end = a.find(YYYY);
  if(pos_end == string::npos) {
    cout << "XXXXXXXXXXXXX" <<endl;
  }
  return 0;
}
